/************************/
/*This File is not used */
/************************/

#ifndef _nsPerseusMime_H_
#define _nsPerseusMime_H_

//#include "nsCURILoader.h"
#include "nsStringAPI.h"
#include "nsIURIContentListener.h"
#include "nsCOMPtr.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"

#include "nsPerseusUtil.h"

/*2e7ac5cf-fcb0-4d38-a0ab-19fa47f62645*/
#define NS_PERSEUSMIME_CID { \
    0x2e7ac5cf, \
    0xfcb0, \
    0x4d38, \
      {0xa0, 0xab, 0x19, 0xfa, 0x47, 0xf6, 0x26, 0x45} \
}

#define NS_PERSEUSMIME_CONTRACTID "@mozilla.org/security/perseusmime;1"
class PerseusInitDl : public nsIStreamListener
{
public:
  PerseusInitDl() {NS_ASSERTION(PR_FALSE, "don't use this constructor."); }
  PerseusInitDl(PRUint32 type);
  virtual ~PerseusInitDl();

  NS_DECL_ISUPPORTS
  NS_DECL_NSIREQUESTOBSERVER
  NS_DECL_NSISTREAMLISTENER

  enum {UNKNOWN_TYPE = 0};
  enum {CONV  = 1};

protected:
  char* mByteData;
  PRInt32 mBufferOffset;
  PRInt32 mBufferSize;
  PRUint32 mType;
  PRBool mDoSilentDownload;
  nsString mCrlAutoDownloadKey;
  nsCOMPtr<nsIURI> mURI;
  nsresult handleContentDownloadError(nsresult errCode);

};

class nsPerseusMime : public nsIURIContentListener
{
public:
  nsPerseusMime();
  virtual ~nsPerseusMime();
  nsresult init();

  NS_DECL_ISUPPORTS
  NS_DECL_NSIURICONTENTLISTENER

private:
    nsCOMPtr<nsISupports> mLoadCookie;
    nsCOMPtr<nsIURIContentListener> mParentContentListener;

};

#endif // _nsPerseusMime_H_

